package com.xt.mvcpilot.data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.NotEmpty;

/**
 * represent the role class in the user class
 * 
 * 
 * @author txiao
 *
 */
@Entity
@Table(name="PERMISSION")
@org.hibernate.annotations.Entity(
		dynamicInsert=true, //not insert null property 
		dynamicUpdate=true  //not update unchanged property
)
public class Permission extends AppBasicDBObject{ 

	private static final long serialVersionUID = -6940566416201949150L;
	
	@NotEmpty(message="{permission.validator.name.required}")
	@Size(min = 2, max = 40, message="{permission.validator.name.required}")
	@Column(name = "name")
	private String name;
	
	public Permission(){}

	//Getters and Setters
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
}
